;
;  PDS Pc1.21 :000: (c) P.D.Systems Ltd 1985-88
;
;
;       File  "IN-GAME ALIEN CODE!"
;    Version          09.63
;         By  "IT'S STILL ME-JAZ.R"
;
;     Created on Sat the 14th of May 1988
;        Last update 08:36 on 25/04/90
;
;**************************************************************************
;*  APEX MUSIC PLAYER : COPYRIGHT JOHN ROWLANDS 1988                      *
;**************************************************************************

  ORG $1A00,$0400
MSTART

CFFF  HEX 00


C823  INC CD74  ;music play
C826  LDA CD74
C829  CMP CD73
C82C  BCC C836  ;C833
C82E  LDA #0
C830  STA CD74
C836  CLC
C833  LDA CF40
C837  ADC CD90
C83A  STA CF40
C83D  CMP #8
C83F  BCC C847
C841  AND #7
C843  STA CF40
C846  SEC
C847  LDA CF41
C84A  ADC CD91
C84D  STA CF41

C850  LDX #2  ;x:number of voices to be played
C852  LDY CE17,X
C855  STY $FE
C85A  CLC
C857  LDA CDBA,X
C85B  ADC #1
C85D  CMP CD8D,X
C860  BCC C876
C862  INC CDBD,X
C868  CLC
C865  LDA CDAB,X
C869  ADC #1
C86B  CMP #3
C86D  BCC C871
C86F  LDA #0
C871  STA CDAB,X
C874  LDA #0
C876  STA CDBA,X
C879  LDA CE14,X
C87C  STA $FC
C87E  LDA CE11,X
C881  STA $FD
C883  LDA CD74
C886  BNE C8C4
C888  INC CD9F,X
C88B  LDA CDC3,X
C88E  CMP #$FF
C890  BEQ C89D
C892  CMP #0
C894  BNE C8C4
C896  LDA CE0E,X
C899  CMP #1
C89B  BNE C8C4

C89D  LDY #0
C8A1  SEC
C89F  LDA ($FC),Y
C8A2  SBC #1
C8A4  CMP #$25
C8A6  BCS C8C4
;C8A8 ASL
C8A9  TAY
C8AA  LDA CEE1,Y
C8AD  STA C8BC+1
C8B0  LDA CEE2,Y
C8B3  STA C8BC+2
C8B6  LDY #1
C8B8  LDA ($FC),Y
C8BA  LDY $FE
C8BC  JSR $FFFF
C8BF  JSR CD60  ;CD5E
C8C2  BNE C89D

C8C4  LDY $FE
C8C6  LDA CD7B,X  ;rest/duration of note?
C8C9  BEQ C930
C8CB  LDA CD93,X
C8CE  BEQ C8DE
C8D0  LDA CD9F,X
C8D3  CMP CD9C,X
C8D6  BCC C8DE

C8D8  LDA CD93,X
C8DB  JSR CCB4
C8DE  LDA CDA2,X
C8E1  BEQ C8E6
C8E3  JSR CC4E


C8E6  LDA CD87,X  ;WAVEFLIP?
C8E9  BEQ C920  ;NO WAVEFLIP
C8EB  CMP #6  ;1ST TIMER?
C8ED  BCC C8FE  ;YES

C8EF  LDA CDBD,X
C8F2  AND #1
C8F4  BNE C918

C8F6  LDA CD87,X
C8F9  SEC
C8FA  SBC #5
C8FC  JMP C912  ;BPL

C8FE  LDA CD9F,X
C901  CMP #1
C903  BCC C918

C905  LDA CD8A,X
C908  BEQ C90F
C90A  CMP CD9F,X
C90D  BCC C918

C90F  LDA CD87,X
C912  TAY
C913  LDA CE1B,Y  ;DELAY ?
C916  BNE C91B

C918  LDA CD7E,X
C91B  LDY $FE
C91D  STA CF2F,Y  ;EO WAVEFLIP


C920  LDA CD84,X
C923  BEQ C928
C925  JSR CC1F

C928  LDA CDEA,X
C92B  BEQ C930
C92D  JSR CBCD

C930  LDA CD74
C933  BNE C938
C935  JSR C94A

C938  LDA $FC
C93A  STA CE14,X
C93D  LDA $FD
C93F  STA CE11,X
C942  DEX
;C943 CPX #$FF
C945  BMI C96F
C947  JMP C852
C94A  LDA CE0E,X
C94D  SEC
C94E  SBC #1
C950  STA CE0E,X
C953  BCS C958
C955  DEC CDC3,X
C958  LDA CDC3,X
C95B  BNE C96F
C95D  LDA CE0E,X
C960  BEQ C970
C962  CMP CD81,X
C965  BCS C96F
C967  LDA CF2F,Y
C96A  AND #$FE
C96C  STA CF2F,Y
C96F  RTS

C970  STA CF2D,Y
C973  STA CD9F,X
C976  STA CDC6,X
C979  STA CDCC,X
C97C  STA CDC9,X
C97F  STA CDBA,X
C982  STA CDBD,X
C985  STA CDAB,X
C988  CPX CD72
C98B  BNE C996
C98D  STA CF40
C990  LDA CD92
C993  STA CF41
C996  LDA CDE7,X
C999  STA CF30,Y
C99C  LDA CDDE,X
C99F  STA CF31,Y
C9A2  LDA CDE4,X
C9A5  STA CF2E,Y
C9A8  LDA CDA8,X
C9AB  STA CDA5,X
C9AE  LDY #0
C9B0  LDA ($FC),Y
C9B2  STA CD7B,X
C9B5  BEQ C9DB
C9B7  STA $FF
C9B9  LDA CDB1,X
C9BC  BEQ C9CB
C9BE  CLC
C9BF  ADC $FF
C9C1  JSR CD46
C9C4  ;STA CDB4,X   ;not needed
C9C7  TYA
C9C8  STA CDB7,X
C9CB  LDA CDAE,X
C9CE  BEQ C9D6
C9D0  CLC
C9D1  ADC $FF
C9D3  JSR CB75
C9D6  LDA $FF
C9D8  JSR CD46
C9DB  PHA
C9DC  TYA
C9DD  LDY $FE
C9DF  STA CF2C,Y
C9E2  STA CD78,X
C9E5  PLA
C9E6  STA CF2B,Y
C9E9  STA CD75,X
C9EC  LDY #1
C9EE  LDA ($FC),Y
C9F0  LDY $FE
C9F2  STA CE0E,X
C9F5  JSR CD60

C9F8  LDA CDE1,X  ;SETUP ORIGINAL WAVEFORM
C9FB  STA CF2F,Y
C9FE  STA CD7E,X

CA01  LDY #0
CA03  LDA ($FC),Y
CA05  CMP #$19
CA07  BNE CA11+1
CA09  INY
CA0A  LDA ($FC),Y
CA0C  PHA
CA0D  JSR CD60
CA10  PLA
CA11  BIT $00A9 ;CA11 : BIT $00A9
MOD DB  0
CA14  STA CDC3,X
CA17  RTS

CA18  LDA #0  ;music set up
CA1A  LDY #$9B
CA1C  STA CD72-1,Y
CA1F  DEY
CA20  BNE CA1C
CA22  LDY #2
CA2F  LDA #2
CA31  STA CD81,Y
CA34  LDA #0  ;initial delay
CA36  STA CDC3,Y
CA24  LDA #1
CA26  STA CE0E,Y
CA29  STA CE0B,Y
CA39  DEY
CA3A  BPL CA2F  ;CA24
CA2C  STA CD73
CA3C  LDA $FC
CA3E  STA CE1A
CA41  CLC
CA42  ADC #4
CA44  STA CE14
CA47  LDA $FD
CA49  STA CE1B
CA4C  ADC #0
CA4E  STA CE11
CA51  LDX #$7E
CA53  LDY #0
CA55  LDA ($FC),Y
CA57  CLC
CA58  ADC CE14
CA5B  STA CD97,X
CA5E  PHP
CA5F  INY
CA60  PLP
CA61  LDA ($FC),Y
CA63  ADC CE11
CA66  STA CD94,X
CA69  INY
CA6A  INX
CA6B  BPL CA55
CA6D  JSR CA81
CA70  JSR C814
CA73  JSR C814
;CA76 LDA #1
CA78  INC CFFF
CA7B  RTS
CA7C  LDA #0
CA7E  STA CFFF
CA81  LDX #$17
;CA83 LDA #9  ;?
;CA85 STA CF2B,X
CA88  LDA #0
CA8A  STA CF2B,X
CA90  DEX
CA91  BPL CA88
CA8D  STA $D418
CA93  RTS

CAAC  STA $FF
CAAE  TXA
CAAF  TAY
CAB0  LDA CDED,Y
CAB3  CLC
CAB4  ADC #1
CAB6  STA CDED,Y
CAB9  CMP $FF
CABB  BCS CAC7
CABD  LDA CDF3,Y
CAC0  STA $FC
CAC2  LDA CDF9,Y
CAC5  STA $FD
CAC7  RTS

CAC8  TXA
CAC9  TAY
CACA  LDA $FC
CACC  STA CDF3,Y
CACF  LDA $FD
CAD1  STA CDF9,Y
CAD4  LDA #0
CAD6  STA CDED,Y
CAD9  RTS

CADA  STA $FF
CADC  TXA
CADD  CLC
CADE  ADC #3
CAE0  BNE CAAF
CAE2  TXA
CAE3  CLC
CAE4  ADC #3
CAE6  BNE CAC9
CAE8  STA CDD5,X
CAEB  RTS

CAFC  CMP #$64
CAFE  BCC CB06
CB00  SBC #$64
CB02  STA CD81,X
CB05  RTS
CB06  STA CD8A,X
CB09  RTS

CB0E  CMP #$63
CB10  BCC CB18
CB12  SBC #$64
CB14  STA CD72
CB17  RTS
CB18  STA CD87,X
CB1B  RTS

CB2C  PHA
CB2D  AND #$0F
CB2F  STA CDD2,X
CB32  PLA
CB33  LSR
CB34  LSR
CB35  LSR
CB36  LSR
CB37  STA CDCF,X
CB3A  RTS
CB3B  STA CE0B,X
CB3E  RTS
CB3F  STA CF42
CB42  RTS
CB43  STA CD92
CB46  RTS

CB4F  CLC   ;volume
CB50  ADC CF43
CB53  STA CF43
CB56  RTS


CBCD  LDA CDBA,X
CBD0  BNE CC0B  ;rts
CBD2  LDA CDCF,X
CBD5  BEQ CC0C
CBD7  LDA CDCC,X
CBDA  BEQ CBF9
CBDC  LDA CF2D,Y
CBDF  SEC
CBE0  SBC CDEA,X
CBE3  STA CF2D,Y
CBE6  BCS CC1E  ;rts
CBE8  LDA CF2E,Y
CBEB  SBC #0
CBED  STA CF2E,Y
CBF0  CMP CDD2,X
CBF3  BCS CC1E  ;rts
CBF5  LDA #0
CBF7  BEQ CC08
CBF9  LDA CF2E,Y
CBFC  CMP CDCF,X
CBFF  BCC CC0C
CC01  CMP CDD2,X
CC04  BCC CC1E
CC06  LDA #1
CC08  STA CDCC,X
CC0B  RTS
CC0C  LDA CF2D,Y
CC0F  CLC
CC10  ADC CDEA,X
CC13  STA CF2D,Y
CC16  LDA CF2E,Y
CC19  ADC #0
CC1B  STA CF2E,Y
CC1E  RTS

CAA0  STA CDE1,X
CAA3  RTS

CC1F  CMP #1
CC21  BNE CC35
CC23  LDA CDBD,X
CC26  LSR
CC27  BCS CC4B
CC29  LDA CD96,X
CC2C  STA CF2C,Y
CC2F  LDA CD99,X
CC32  JMP CC47
CC35  LDA CDAB,X
CC38  BEQ CC4B
CC3A  CMP #1
CC3C  BEQ CC29
CC3E  LDA CDB7,X
CC41  STA CF2C,Y
CC44  LDA CDB4,X
CC47  STA CF2B,Y
CC4A  RTS
CC4B  JMP CD39
CC4E  LDA CDA5,X
CC51  BEQ CC57
CC53  DEC CDA5,X
CC56  RTS
CC57  LDA CDC9,X
CC5A  CMP #1
CC5C  BEQ CC68
CC5E  CMP #2
CC60  BEQ CC68
CC62  JSR CC86
CC65  JMP CC6B
CC68  JSR CC9B
CC6B  LDA CDC6,X
CC6E  CLC
CC6F  ADC #1
CC71  CMP CE0B,X
CC74  BCC CC82
CC76  LDA CDC9,X
CC79  ADC #0
CC7B  AND #3
CC7D  STA CDC9,X
CC80  LDA #0
CC82  STA CDC6,X
CC85  RTS

CB57  STA CDB1,X
CB5A  RTS

CB5B  PHA
CB5C  LSR
CB5D  LSR
CB5E  LSR
CB5F  STA CD91
CB62  PLA
CB63  AND #7
CB65  STA CD90
CB68  RTS

CBC9  STA CD73
CBCC  RTS

CB69  STA CDAE,X
CB6C  RTS

CB47  CLC
CB48  ADC CDD5,X
CB4B  STA CDD5,X
CB4E  RTS

CB71  STA CDA8,X
CB74  RTS

CBB0  LDA CDFF,X
CBB3  STA $FC
CBB5  LDA CE05,X
CBB8  STA $FD
CBBA  LDA CE02,X
CBBD  STA CDFF,X
CBC0  LDA CE08,X
CBC3  STA CE05,X
CBC6  JMP CD60

CB6D  STA CDC0,X
CB70  RTS

CC86  LDA CD75,X
CC89  CLC
CC8A  ADC CDA2,X
CC8D  STA CD75,X
CC90  STA CF2B,Y
CC93  LDA CD78,X
CC96  ADC #0
CC98  JMP CCAD
CC9B  LDA CD75,X
CC9E  SEC
CC9F  SBC CDA2,X
CCA2  STA CD75,X
CCA5  STA CF2B,Y
CCA8  LDA CD78,X
CCAB  SBC #0
CCAD  STA CD78,X
CCB0  STA CF2C,Y
CCB3  RTS


CD46  AND #$7F  ;get note to be played
CD48  CLC
CD49  ADC CDD5,X
CD4C  ASL
CD4D  TAY
CD4E  LDA CE21,Y
CD51  CLC
CD52  ADC CDC0,X
CD55  PHA
CD56  LDA CE22,Y
CD59  ADC #0  ;frequency offset
CD5B  TAY
CD5C  PLA
CD5D  RTS

CAF0  STA CDDB,X
CAF3  RTS

CCB4  CMP #1  ;vibrato/note flip
CCB6  BEQ CCB8
CD30  CMP #3  ;slide down
CD32  BEQ CD1A
CD34  CMP #2  ;slide up
CD36  BEQ CD07
CD38  RTS

CCB8  LDA CD96,X  ;note limit - vibrate/note flip
CCBB  CMP CD78,X
CCBE  BCC CCF0
CCC0  BNE CCCC
CCC2  LDA CD99,X
CCC5  CMP CD75,X
CCC8  BEQ CD38
CCCA  BCC CCF0
CCCC  JSR CD07
CCCF  LDA CD78,X
CCD2  CMP CD96,X
CCD5  BCC CCB3
CCD7  BNE CCE1
CCD9  LDA CD75,X
CCDC  CMP CD99,X
CCDF  BCC CCB3
CCE1  LDA CD99,X
CCE4  STA CD75,X
CCE7  LDA CD96,X
CCEA  STA CD78,X
CCED  JMP CD39

CCF0  JSR CD1A
CCF3  LDA CD78,X
CCF6  CMP CD96,X
CCF9  BCC CCE1
CCFB  BNE CCB3
CCFD  LDA CD75,X
CD00  CMP CD99,X
CD03  BCS CCB3
CD05  BCC CCE1

CD07  CLC   ;add to note - slide up
CD0A  LDA CD75,X
CD0B  ADC CDD8,X
CD0E  STA CD75,X
CD11  LDA CD78,X
CD14  ADC CDDB,X
CD17  JMP CD2A

CD1A  SEC   ;subtract from note - slide down
CD1D  LDA CD75,X
CD1E  SBC CDD8,X
CD21  STA CD75,X
CD24  LDA CD78,X
CD27  SBC CDDB,X
CD2A  STA CD78,X
;CD2D JMP CD39

CD39  LDA CD78,X  ;chuck values into voice frequencies
CD3C  STA CF2C,Y
CD3F  LDA CD75,X
CD42  STA CF2B,Y
CD45  RTS

CAEC  STA CDEA,X
CAEF  RTS

CD60  CLC
CD5E  LDA $FC
CD61  ADC #2
CD63  STA $FC
CD65  BCC CD69
CD67  INC $FD
CD69  RTS

MUSICSET  STA $FC
  STX $FD
  LDA #0
C805  STA CFFF
C80C  JMP CA18  ;set up


CB28  STA CD9C,X
CB2B  RTS

CB24  STA CDA2,X
CB27  RTS

CB20  STA CD93,X
CB23  RTS

CB1C  STA CD84,X
CB1F  RTS
;
CB0A  STA CD8D,X
CB0D  RTS
;
CAA4  STA CDE7,X
CAA7  RTS

CA9C  STA CF43  ;volume
CA9F  RTS


CB75  JSR CD46
CB78  STA CD99,X
CB7B  TYA
CB7C  STA CD96,X
CB7F  RTS
CB80  PHA
CB81  LDA CDFF,X
CB84  STA CE02,X
CB87  LDA CE05,X
CB8A  STA CE08,X
CB8D  LDA $FC
CB8F  STA CDFF,X
CB92  LDA $FD
CB94  STA CE05,X
CB97  LDY #2
CB99  LDA ($FC),Y
CB9B  STA $FF
CB9D  PLA
CB9E  CLC
CB9F  ADC CE1A
CBA2  STA $FC
CBA4  LDA $FF
CBA6  ADC CE1B
CBA9  STA $FD
CBAB  PLA
CBAC  PLA
CBAD  JMP C89D

CAA8  STA CDDE,X
CAAB  RTS

CA94  JSR CA7C
CA97  PLA
CA98  PLA
CA99  PLA
CA9A  PLA
CA9B  RTS

MUSICPLY  LDA CFFF
C812  BEQ C822
C814  JSR C823  ;play
NUMFREE LDY #$18  ;y:number of voices to be played / 0-7,8-15,16-23
C819  LDA CF2B,Y  ;                          24-vol
C81C  STA $D400,Y ;sid vars
C81F  DEY
C820  BPL C819
VOLUME  NOP
  LDA CF2B+24
  STA $D418
C822  RTS

CAF4  STA CDD8,X
CAF7  RTS

CF44  HEX 41
CF45  HEX AD
CF46  HEX 02
CF47  HEX 03
CF48  HEX 11
CF49  HEX 08
CF4A  HEX 01
CF4B  HEX 07
CF4C  HEX 00
CF4D  HEX 0F
CF4E  HEX 00
CF4F  HEX 24
CF50  HEX 0F
CF51  HEX 03
CF52  HEX 07
CF53  HEX 00
CF54  HEX 08
CF55  HEX 00
CF56  HEX 03
CF57  HEX 41
CF58  HEX B2
CF59  HEX 02
CF5A  HEX 03
CF5B  HEX 11
CF5C  HEX 08
CF5D  HEX 01
CF5E  HEX 07
CF5F  HEX 00
CF60  HEX 0F
CF61  HEX 00
CF62  HEX 24
CF63  HEX 00
CF64  HEX A5
CF65  HEX 00
CF66  HEX 78
CF67  HEX 01
CF68  HEX 00
CF69  HEX 01
CF6A  HEX 25
CF6B  HEX 02
CF6C  HEX 01
CF6D  HEX 0F
CF6E  HEX 03
CF6F  HEX 41
CF70  HEX 04
CF71  HEX 0A
CF72  HEX 15
CF73  HEX FA
CF74  HEX 0E
CF75  HEX 64
CF76  HEX 02
CF77  HEX 0C
CF78  HEX 0A
CF79  HEX AD
CF7A  HEX 0D
CF7B  HEX 0A
CF7C  HEX 0C
CF7D  HEX 00
CF7E  HEX 0F
CF7F  HEX 01
CF80  HEX 22
CF81  HEX 9A
CF82  HEX 95
CF83  HEX 80
CF84  HEX 0F
CF85  HEX 00
CF86  HEX 02
CF87  HEX 0A
CF88  HEX 0A
CF89  HEX 08
CF8A  HEX 23
CF8B  HEX 5F
CF8C  HEX 04
CF8D  HEX 00
CF8E  HEX 23
CF8F  HEX 5F
CF90  HEX 04
CF91  HEX 00
CF92  HEX 23
CF93  HEX 5F
CF94  HEX 04
CF95  HEX 00
CF96  HEX 23
CF97  HEX 5F
CF98  HEX 04
CF99  HEX 00
CF9A  HEX 14
CF9B  HEX 02
CF9C  HEX 23
CF9D  HEX 5F
CF9E  HEX 04
CF9F  HEX 00
CFA0  HEX 23
CFA1  HEX 5F
CFA2  HEX 04
CFA3  HEX 00
CFA4  HEX 14
CFA5  HEX 00
CFA6  HEX 1F
CFA7  HEX 0C
CFA8  HEX A6
CFA9  HEX 20
CFAA  HEX 02
CFAB  HEX 09
CFAC  HEX 13
CFAD  HEX 00
CFAE  HEX 23
CFAF  HEX CD
CFB0  HEX 04
CFB1  HEX 00
CFB2  HEX 12
CFB3  HEX 0A
CFB4  HEX 14
CFB5  HEX 0C
CFB6  HEX 02
CFB7  HEX 0C
CFB8  HEX 9A
CFB9  HEX 20
CFBA  HEX 00
CFBB  HEX 60
CFBC  HEX 19
CFBD  HEX 00
CFBE  HEX 02
CFBF  HEX 09
CFC0  HEX 11
CFC1  HEX 00
CFC2  HEX 9A
CFC3  HEX 08
CFC4  HEX 9D
CFC5  HEX 08
CFC6  HEX 9A
CFC7  HEX 08
CFC8  HEX 9D
CFC9  HEX 08
CFCA  HEX 9A
CFCB  HEX 08
CFCC  HEX 9D
CFCD  HEX 08
CFCE  HEX 9A
CFCF  HEX 08
CFD0  HEX 95
CFD1  HEX 08
CFD2  HEX 10
CFD3  HEX 04
CFD4  HEX 23
CFD5  HEX CD
CFD6  HEX 04
CFD7  HEX 00
CFD8  HEX 14
CFD9  HEX 18
CFDA  HEX 23
CFDB  HEX CD
CFDC  HEX 04
CFDD  HEX 00
CFDE  HEX 23
CFDF  HEX CD
CFE0  HEX 04
CFE1  HEX 00
CFE2  HEX 14
CFE3  HEX 0C
CFE4  HEX 23
CFE5  HEX CD
CFE6  HEX 04
CFE7  HEX 00
CFE8  HEX 14
CFE9  HEX 00
CFEA  HEX 02
CFEB  HEX 0A
CFEC  HEX 23
CFED  HEX 5F
CFEE  HEX 04
CFEF  HEX 00
CFF0  HEX 23
CFF1  HEX 5F
CFF2  HEX 04
CFF3  HEX 00
CFF4  HEX 23
CFF5  HEX 5F
CFF6  HEX 04
CFF7  HEX 00
CFF8  HEX 14
CFF9  HEX 02
CFFA  HEX 23
CFFB  HEX 5F
CFFC  HEX 04
CFFD  HEX 00
CFFE  HEX 23


CAF8  STA CDE4,X
CAFB  RTS

;CD6A DB  0,0,0,0,0,0,0,0 ;don't need
; DB  0,0,0

CD72  HEX 00

CD73  HEX 00  ;tempo
CD74  HEX 00  ;tempo cnt


CD75  HEX 00
CD76  HEX 00
CD77  HEX 00

CD78  HEX 00
CD79  HEX 00
CD7A  HEX 00

CD7B  HEX 00
CD7C  HEX 00
CD7D  HEX 00

CD7E  HEX 00  ;waveform ?
CD7F  HEX 00
CD80  HEX 00

CD81  HEX 00
CD82  HEX 00
CD83  HEX 00

CD84  HEX 00
CD85  HEX 00
CD86  HEX 00
CD87  HEX 00
CD88  HEX 00
CD89  HEX 00

CD8A  HEX 00  ;ORIGINAL WAVEFLIP TIME (00-99)
CD8B  HEX 00
CD8C  HEX 00

CD8D  HEX 00
CD8E  HEX 00
CD8F  HEX 00

CD90  HEX 00
CD91  HEX 00
CD92  HEX 00

CD93  HEX 00
CD94  HEX 00
CD95  HEX 00

CD96  HEX 00
CD97  HEX 00
CD98  HEX 00

CD99  HEX 00
CD9A  HEX 00
CD9B  HEX 00

CD9C  HEX 00
CD9D  HEX 00
CD9E  HEX 00

CD9F  HEX 00  ;WAVEFLIP DELAY (MODIFIED)
CDA0  HEX 00
CDA1  HEX 00

CDA2  HEX 00
CDA3  HEX 00
CDA4  HEX 00

CDA5  HEX 00
CDA6  HEX 00
CDA7  HEX 00

CDA8  HEX 00
CDA9  HEX 00
CDAA  HEX 00

CDAB  HEX 00
CDAC  HEX 00
CDAD  HEX 00

CDAE  HEX 00
CDAF  HEX 00
CDB0  HEX 00

CDB1  HEX 00
CDB2  HEX 00
CDB3  HEX 00

CDB4  HEX 00  ;notes  v1
CDB5  HEX 00  ; v2
CDB6  HEX 00  ; v3
CDB7  HEX 00  ; v1
CDB8  HEX 00  ; v2
CDB9  HEX 00  ; v3

CDBA  HEX 00
CDBB  HEX 00
CDBC  HEX 00

CDBD  HEX 00
CDBE  HEX 00
CDBF  HEX 00

CDC0  HEX 00
CDC1  HEX 00
CDC2  HEX 00

CDC3  HEX 00
CDC4  HEX 00
CDC5  HEX 00

CDC6  HEX 00
CDC7  HEX 00
CDC8  HEX 00

CDC9  HEX 00
CDCA  HEX 00
CDCB  HEX 00

CDCC  HEX 00
CDCD  HEX 00
CDCE  HEX 00

CDCF  HEX 00
CDD0  HEX 00
CDD1  HEX 00

CDD2  HEX 00
CDD3  HEX 00
CDD4  HEX 00

CDD5  HEX 00
CDD6  HEX 00
CDD7  HEX 00

CDD8  HEX 00  ;slide speed lo
CDD9  HEX 00
CDDA  HEX 00

CDDB  HEX 00  ;slide speed hi
CDDC  HEX 00
CDDD  HEX 00

CDDE  HEX 00
CDDF  HEX 00
CDE0  HEX 00

CDE1  HEX 00  ;waveform SETUP
CDE2  HEX 00
CDE3  HEX 00

CDE4  HEX 00
CDE5  HEX 00
CDE6  HEX 00
CDE7  HEX 00
CDE8  HEX 00
CDE9  HEX 00
CDEA  HEX 00
CDEB  HEX 00
CDEC  HEX 00
CDED  HEX 00
CDEE  HEX 00
CDEF  HEX 00
CDF0  HEX 00
CDF1  HEX 00
CDF2  HEX 00
CDF3  HEX 00
CDF4  HEX 00
CDF5  HEX 00
CDF6  HEX 00
CDF7  HEX 00
CDF8  HEX 00
CDF9  HEX 00
CDFA  HEX 00
CDFB  HEX 00
CDFC  HEX 00
CDFD  HEX 00
CDFE  HEX 00
CDFF  HEX 00
CE00  HEX 00
CE01  HEX 00
CE02  HEX 00
CE03  HEX 00
CE04  HEX 00
CE05  HEX 00
CE06  HEX 00
CE07  HEX 00
CE08  HEX 00
CE09  HEX 00
CE0A  HEX 00
CE0B  HEX 00
CE0C  HEX 00
CE0D  HEX 00

CE0E  HEX 00
CE0F  HEX 00
CE10  HEX 00

CE11  HEX 00
CE12  HEX 00
CE13  HEX 00

CE14  HEX 00
CE15  HEX 00
CE16  HEX 00

CE17  HEX 00
CE18  HEX 07
CE19  HEX 0E

CE1A  HEX 00
CE1B  HEX 00

CE1C  HEX 41  ;waveform values
CE1D  HEX 21
CE1E  HEX 11
CE1F  HEX 81
CE20  HEX 51


CF2B  HEX 00  ;sid vars (copied over $D400-$D418 / 50th)
CF2C  HEX 00
CF2D  HEX 00
CF2E  HEX 00
CF2F  HEX 00  ;waveform
CF30  HEX 00
CF31  HEX 00
CF32  HEX 00

CF33  HEX 00
CF34  HEX 00
CF35  HEX 00
CF36  HEX 00
CF37  HEX 00  ;waveform
CF38  HEX 00
CF39  HEX 00
CF3A  HEX 00

CF3B  HEX 00
CF3C  HEX 00
CF3D  HEX 00
CF3E  HEX 00
CF3F  HEX 00  ;waveform
CF40  HEX 00
CF41  HEX 00
CF42  HEX 00

CF43  HEX 00



CEE1  DL  CA9C  ;look-up table LO
CEE3  DL  CAA4
CEE5  DL  CAA0
CEE7  DL  CAF8
CEE9  DL  CAFC
CEEB  DL  CB0A
CEED  DL  CB0E
CEEF  DL  CB1C
CEF1  DL  CB28
CEF3  DL  CAA8
CEF5  DL  CB24
CEF7  DL  CAF0
CEF9  DL  CAF4
CEFB  DL  CAEC
CEFD  DL  CB20
CEFF  DL  CAAC
CF01  DL  CAC8
CF03  DL  CADA
CF05  DL  CAE2
CF07  DL  CAE8
CF09  DL  CB2C
CF0B  DL  CB3B
CF0D  DL  CB3F
CF0F  DL  CB43
CF11  DL  CB6C
CF13  DL  CB47
CF15  DL  CB4F  ;volume
CF17  DL  CB57
CF19  DL  CB5B
CF1B  DL  CA94
CF1D  DL  CB69
CF1F  DL  CB6D
CF21  DL  CB71
CF23  DL  CB75
CF25  DL  CB80
CF27  DL  CBB0
CF29  DL  CBC9

CEE2  DH  CA9C  ;look-up table HI
CEE4  DH  CAA4
CEE6  DH  CAA0
CEE8  DH  CAF8
CEEA  DH  CAFC
CEEC  DH  CB0A
CEEE  DH  CB0E
CEF0  DH  CB1C
CEF2  DH  CB28
CEF4  DH  CAA8
CEF6  DH  CB24
CEF8  DH  CAF0
CEFA  DH  CAF4
CEFC  DH  CAEC
CEFE  DH  CB20
CF00  DH  CAAC
CF02  DH  CAC8
CF04  DH  CADA
CF06  DH  CAE2
CF08  DH  CAE8
CF0A  DH  CB2C
CF0C  DH  CB3B
CF0E  DH  CB3F
CF10  DH  CB43
CF12  DH  CB6C
CF14  DH  CB47
CF16  DH  CB4F
CF18  DH  CB57
CF1A  DH  CB5B
CF1C  DH  CA94
CF1E  DH  CB69
CF20  DH  CB6D
CF22  DH  CB71
CF24  DH  CB75
CF26  DH  CB80
CF28  DH  CBB0
CF2A  DH  CBC9


CE21  HEX 06  ;note table
CE22  HEX 01
CE23  HEX 16
CE24  HEX 01
CE25  HEX 27
CE26  HEX 01
CE27  HEX 38
CE28  HEX 01
CE29  HEX 4B
CE2A  HEX 01
CE2B  HEX 5E
CE2C  HEX 01
CE2D  HEX 73
CE2E  HEX 01
CE2F  HEX 89
CE30  HEX 01
CE31  HEX A1
CE32  HEX 01
CE33  HEX BA
CE34  HEX 01
CE35  HEX D4
CE36  HEX 01
CE37  HEX F0
CE38  HEX 01
CE39  HEX 0D
CE3A  HEX 02
CE3B  HEX 2C
CE3C  HEX 02
CE3D  HEX 4E
CE3E  HEX 02
CE3F  HEX 71
CE40  HEX 02
CE41  HEX 96
CE42  HEX 02
CE43  HEX BD
CE44  HEX 02
CE45  HEX E7
CE46  HEX 02
CE47  HEX 13
CE48  HEX 03
CE49  HEX 42
CE4A  HEX 03
CE4B  HEX 74
CE4C  HEX 03
CE4D  HEX A8
CE4E  HEX 03
CE4F  HEX E0
CE50  HEX 03
CE51  HEX 1B
CE52  HEX 04
CE53  HEX 59
CE54  HEX 04
CE55  HEX 9C
CE56  HEX 04
CE57  HEX E2
CE58  HEX 04
CE59  HEX 2C
CE5A  HEX 05
CE5B  HEX 7B
CE5C  HEX 05
CE5D  HEX CE
CE5E  HEX 05
CE5F  HEX 27
CE60  HEX 06
CE61  HEX 84
CE62  HEX 06
CE63  HEX E8
CE64  HEX 06
CE65  HEX 51
CE66  HEX 07
CE67  HEX C0
CE68  HEX 07
CE69  HEX 36
CE6A  HEX 08
CE6B  HEX B3
CE6C  HEX 08
CE6D  HEX 38
CE6E  HEX 09
CE6F  HEX C4
CE70  HEX 09
CE71  HEX 59
CE72  HEX 0A
CE73  HEX F6
CE74  HEX 0A
CE75  HEX 9D
CE76  HEX 0B
CE77  HEX 4E
CE78  HEX 0C
CE79  HEX 09
CE7A  HEX 0D
CE7B  HEX D0
CE7C  HEX 0D
CE7D  HEX A2
CE7E  HEX 0E
CE7F  HEX 81
CE80  HEX 0F
CE81  HEX 6D
CE82  HEX 10
CE83  HEX 67
CE84  HEX 11
CE85  HEX 70
CE86  HEX 12
CE87  HEX 88
CE88  HEX 13
CE89  HEX B2
CE8A  HEX 14
CE8B  HEX ED
CE8C  HEX 15
CE8D  HEX 3A
CE8E  HEX 17
CE8F  HEX 9C
CE90  HEX 18
CE91  HEX 13
CE92  HEX 1A
CE93  HEX A0
CE94  HEX 1B
CE95  HEX 44
CE96  HEX 1D
CE97  HEX 02
CE98  HEX 1F
CE99  HEX DA
CE9A  HEX 20
CE9B  HEX CE
CE9C  HEX 22
CE9D  HEX E0
CE9E  HEX 24
CE9F  HEX 11
CEA0  HEX 27
CEA1  HEX 64
CEA2  HEX 29
CEA3  HEX DA
CEA4  HEX 2B
CEA5  HEX 75
CEA6  HEX 2E
CEA7  HEX 38
CEA8  HEX 31
CEA9  HEX 26
CEAA  HEX 34
CEAB  HEX 40
CEAC  HEX 37
CEAD  HEX 89
CEAE  HEX 3A
CEAF  HEX 04
CEB0  HEX 3E
CEB1  HEX B4
CEB2  HEX 41
CEB3  HEX 9C
CEB4  HEX 45
CEB5  HEX C0
CEB6  HEX 49
CEB7  HEX 22
CEB8  HEX 4E
CEB9  HEX C8
CEBA  HEX 52
CEBB  HEX B4
CEBC  HEX 57
CEBD  HEX EB
CEBE  HEX 5C
CEBF  HEX 71
CEC0  HEX 62
CEC1  HEX 4C
CEC2  HEX 68
CEC3  HEX 80
CEC4  HEX 6E
CEC5  HEX 12
CEC6  HEX 75
CEC7  HEX 08
CEC8  HEX 7C
CEC9  HEX 68
CECA  HEX 83
CECB  HEX 39
CECC  HEX 8B
CECD  HEX 80
CECE  HEX 93
CECF  HEX 45
CED0  HEX 9C
CED1  HEX 90
CED2  HEX A5
CED3  HEX 69
CED4  HEX AF
CED5  HEX D7
CED6  HEX B9
CED7  HEX E3
CED8  HEX C4
CED9  HEX 99
CEDA  HEX D0
CEDB  HEX 00
CEDC  HEX DD
CEDD  HEX 25
CEDE  HEX EA
CEDF  HEX 10
CEE0  HEX F8

MEND

